package com.bjpowernode.test01;

public class Book {
    String title;
    int pageNum;

    public Book(){}
    public Book(String title,int pageNum){
        this.title=title;
        this.pageNum=pageNum;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        if (pageNum<200){
            pageNum=200;
        }
        this.pageNum = pageNum;
    }

    public void detail(){
        System.out.println("书的名字是："+this.title+"  书的页数是："+this.pageNum);
    }
}
